package com.wen.service;

import com.wen.pojo.Product;

import java.util.List;

/**
 * @author 20212
 * ProductService service层
 */
public interface ProductService {
    /**
     * 查询全部数据
     *
     * @param page
     * @param size
     * @return
     * @throws Exception
     */
    List<Product> findAll(int page, int size) throws Exception;

    /**
     * 添加数据
     *
     * @param product
     * @return
     * @throws Exception
     */
    int add(Product product) throws Exception;

    /**
     * 删除数据
     *
     * @param id
     * @return
     * @throws Exception
     */
    int deleteById(int id) throws Exception;

    /**
     * 根据id查询
     *
     * @param id
     * @return
     * @throws Exception
     */
    Product findById(int id) throws Exception;

    /**
     * 根据id更改
     * @param product
     * @return
     * @throws Exception
     */
    int updateById(Product product) throws Exception;
}
